package CommentTable;

import comment.Comment;
import page.PageClass;
import utils.JdbcUtils;

import javax.swing.*;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

public class DeleteComment {
    public static void init(String name){
        JFrame frame=new JFrame();
        String info = JOptionPane.showInputDialog(frame,"要删除的评论id编号为:","输入",JOptionPane.WARNING_MESSAGE);
        int yn=JOptionPane.showConfirmDialog(frame, "确认删除该评论？", "确认框", JOptionPane.OK_CANCEL_OPTION);
        if(yn==JOptionPane.YES_OPTION){
            JdbcUtils.JdbcUpdate(Comment.sql_deleteComment,info);
            PageClass.jssum();
            JOptionPane.showMessageDialog(frame, "删除成功");
        }
    }
}
